﻿<UserControl x:Class="VMClusterManager.Controls.VMViews.VMPropertiesView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             MinHeight="300" MinWidth="300">
    <UserControl.Resources>
        
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" Grid.Row="0">
            <ListBox Name="VMPropertiesList" ItemsSource="{Binding RASD}" Margin="5,5,5,5">
            <ListBox.ItemTemplate>
                    <HierarchicalDataTemplate ItemsSource="{Binding Children}">
                        <TextBlock Text="{Binding Name}" Margin="5,5,5,0"/>
                    </HierarchicalDataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
            <ContentControl Content="{Binding ElementName=VMPropertiesList, Path=SelectedItem}" Margin="5,5,5,5" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
                <ContentControl.ContentTemplate>
                    <DataTemplate>
                        <ContentControl Content="{Binding View}"/>
                    </DataTemplate>
                </ContentControl.ContentTemplate>
            </ContentControl>
        </StackPanel>

        <StackPanel Orientation="Horizontal" Grid.Row="1" DataContext="{Binding ElementName=VMPropertiesList, Path=SelectedItem}"
                    HorizontalAlignment="Right">
            <Button Content="OK" Command="{Binding OKCommand}" />
            <Button Content="Cancel" Command="{Binding CancelCommand}"/>
            <Button Content="Apply" Command="{Binding ApplyCommand}"/>
        </StackPanel>
    </Grid>
</UserControl>
